Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Overview
This document describes how object references should be compared in OpenDoc and the motivation behind it.
IsEqualTo
In many places in the part code, object equality is determined by comparing pointers. This will fail when we move to a distributed environment. That's why ODObject has the method ODBoolean ODObject::IsEqualTo(in ODObject anotherObject). The purpose of this method is to determine whether two object refs refer to the same object. If so, kODTrue is returned. Otherwise, kODFalse is returned.
In addition, we have created a function in ODUtils called ODObjectsAreEqual. This function does a pointer comparison when it is legal to do so, thereby preventing the cost of calling ODObject::IsEqualTo.
In summary, it is required to use ODObjectsAreEqual or ODObject::IsEqualTo for all object pointer comparison.